<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
	"http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
	<script src="http://code.jquery.com/jquery-latest.js"></script>
	<script>
		$(document).ready(function() {
			$("#rating").append("Please rate: ");
			for ( var i = 1; i <= 5; i++ )
				$("#rating").append("<a href='#'>" + i + "</a> ");
   
			$("#rating a").click(function(e){
				e.preventDefault();
				$.post("/Hello", {rating: $(this).html()}, function(xml) {
					$("#rating").html(
						"Thanks for rating, current average: " +
						$("average", xml).text() + 
						", number of votes: " +
						$("count", xml).text()
					);
				});
			});
		});
	</script>
</head>

<body>
	<div id="rating"></div>
</body>

</html>